#ifndef _L_3D_DEFINED_H_
#define _L_3D_DEFINED_H_


// define data type

#define		LRGB			unsigned int
#define		MAKERGB(r,g,b)	(0xFF000000 | (r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF)
#define		MAKEARGB(a,r,g,b) ((a&0xFF)<<24 | (r&0xFF)<<16) | ((g&0xFF)<<8) | (b&0xFF)
#define		GETRED(x)	(unsigned char)((x & 0x00FF0000)>>16)
#define		GETGREEN(x)	(unsigned char)((x & 0x0000FF00)>>8)
#define		GETBLUE(x)	(unsigned char)(x & 0x000000FF)
#define		GETALPHA(x) (unsigned char)((x & 0xFF000000)>>24)


typedef	float	Vec2[2];
typedef float	Vec3[3];
typedef	float	MAT[4][4];
typedef	float	QUAT[4];


typedef struct
{
	Vec3	pos;
	Vec3	dir;
	Vec3	up;
} CAMERA;

typedef struct
{
	float	fov;
	float	ratio;
	float	nearz;
	float	farz;
} FOV;

typedef struct
{
	int		x, y;		// width and height
	int		z;			// z-buffer
	int		bpp;		// bit per pixel
	bool	isFull;		// is full screen?
	unsigned long	flags;
	unsigned long	ColorFmt;		// color format
}SCREENMODE;

#endif